// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
//     http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System;
using GSpec.Framework;
using MbUnit.Framework;
using SharpTestsEx;

namespace GSpec.Samples
{
	using Gallio.Common.Collections;
	using Gallio.Framework;

	[TestFixture]
	public class BowlingGameException_Spec
	{
		private BowlingGame bowlingGame;

		[Given]
		public void A_new_bowling_game()
		{
			bowlingGame = new BowlingGame();
		}

		[When]
		public void Hitting_more_than_existing_balls()
		{
			bowlingGame.Hit(10);
		}

		[Then]
		public void There_should_be_an_exception(Exception exception)
		{
			exception.Should().Be.OfType<ArgumentOutOfRangeException>();
		}

		[Then]
		public void Exception_should_have_appropriate_message(Exception exception)
		{
			exception.Message.Should().StartWith("Specified");
		}
	}
}